/*
 * # iohao.com . 渔民小镇
 * Copyright (C) 2021 - present double joker （262610965@qq.com） . All Rights Reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.xy.springboot.game.broker;

import com.iohao.game.bolt.broker.server.BrokerServer;
import com.iohao.game.bolt.broker.server.BrokerServerBuilder;

/**
 * @author 渔民小镇
 * @date 2022-07-09
 */
public class GameBrokerBoot {
    /**
     * 创建游戏网关
     * @param port 端口
     * @return brokerServer
     */
    public BrokerServer createBrokerServer(Integer  port) {
        // broker （游戏网关） 构建器
        BrokerServerBuilder brokerServerBuilder = BrokerServer.newBuilder();
        brokerServerBuilder.port(port);
        return brokerServerBuilder.build();
    }
    /**
     * 启动游戏网关
     * @param port 端口
     */
    public static void start(Integer  port) {
        new GameBrokerBoot().createBrokerServer(port).startup();
    }
}
